<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="../js/vue.min.js" type="text/javascript" charset="utf-8"></script>
		<style type="text/css">
			.text-danger {
				width: 100px;
				height: 100px;
				background: red;
			}
			.active {
				width: 100px;
				height: 100px;
				background: green;
			}
			.fade-enter-active,.fade-leave-active{
				transition: opacity 2s;
			}
			.fade-enter,.fade-leave-to{
				opacity: 0;
			}
		</style>
	</head>
	<body>
		<div id="app">
			<button type="button" @click="isActive = !isActive">点击我</button>
			<transition name="fade">
				<div v-if="isActive" :class="[textDanger,isActive?active:'']"></div>
			</transition>
		</div>
		<script type="text/javascript">
			new Vue({
			  el: '#app',
			  data: {
			    isActive: true,
				active:'active',
				textDanger:'text-danger'
			  }
			})
		</script>
	</body>
</html>
